package com.abu.apply.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 申请记录表
 * </p>
 *
 * @author 阿布
 * @since 2021-02-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("cs_apply_report")
@ApiModel(value = "ApplyReport对象", description = "申请记录表")
public class ApplyReport implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "申请编号")
    @TableId(value = "apply_id", type = IdType.ASSIGN_ID)
    private Long applyId;

    @ApiModelProperty(value = "申请人ID")
    private Long userId;

    @ApiModelProperty(value = "申请人姓名")
    private String applicant;

    @ApiModelProperty(value = "申请人手机号")
    private String applicantPhone;

    @ApiModelProperty(value = "申请人邮箱")
    private String applicantEmail;

    @ApiModelProperty(value = "教室名")
    private String classroomName;

    @ApiModelProperty(value = "使用开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private LocalDateTime beginTime;

    @ApiModelProperty(value = "使用结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "申请理由")
    private String usedReason;

    @ApiModelProperty(value = "0-待审核，1-审核通过，2-已驳回")
    private Integer applyStatus;

    @ApiModelProperty(value = "审核人Id")
    private String reviewerId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "提交申请的时间")
    private LocalDateTime reviewerTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    @TableField("is_deleted")
    @TableLogic
    private Boolean deleted;


}
